package com.xy.util;

/**
 * Created by XuYang
 * 2023/4/21
 * Email:544066591@qq.com
 */
public class ByteUtil {

    public static String bytesToHex(byte[] b) {
        StringBuilder sb = new StringBuilder();
        String stmp;
        for (byte value : b) {
            stmp = Integer.toHexString(value & 0XFF);
            if (stmp.length() == 1) {
                sb.append("0").append(stmp);
            } else {
                sb.append(stmp);
            }
        }
        return sb.toString();
    }
}
